﻿using System.Linq.Expressions;

namespace OpenCompiler.CodeGen
{
	public interface IMethodBuilder
	{
		string Name { get; }
		Visibility Visibility { get; }
		ITypeBuilder TypeBuilder { get; }

		IMethodBuilder WithName(string name);
		IMethodBuilder VisibleTo(Visibility visibility);

		IMethodBodyBuilder Body(MethodBodyContext context);

		Expression ComposedBody { get; }
	}

	public interface IMethodBuilder<T> : IMethodBuilder
		where T : class
	{
		new IMethodBuilder<T> WithName(string name);
		new IMethodBuilder<T> VisibleTo(Visibility visibility);
		new IMethodBodyBuilder<T> Body(MethodBodyContext context);
	}

	public interface IMethodBuilder<T, E> : IMethodBuilder
		where T:class
		where E:Expression
	{
		new IMethodBuilder<T, E> WithName(string name);
		new IMethodBuilder<T, E> VisibleTo(Visibility visibility);
		new IMethodBodyBuilder<T, E> Body(MethodBodyContext context);
	}
}
